<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>成果展示</title>
  <style>
    /*整个文章模块*/
    .Single {
      height: 150px;
      width: 1400px;
      margin: 0 auto;
      border: 1px solid #eee;
      padding: 40px;
      margin-bottom: 10px;
    }

    /*鼠标移动到文章模块上时设置*/
    .Single:hover {
      box-shadow: 0px 0px 25px rgb(117, 117, 117);
      transition: all 0.3s;
    }

    /*文章标题*/
    .Title {
      margin: 0;
      height: 31px;
      text-decoration: none;
      color: black;
      font-size: 25px;
      margin-top: -10px;
    }

    /*文章内容*/
    .Content {
      height: 90px;
      overflow: hidden;
      font-size: 17px;
      margin-top: 15px;
    }

    /* 底部内容 */
    .category{
      margin-top: 20px;
    }

    /*整个分页按钮*/
    .Button {
      width: 1480px;
      margin: auto;
      font-size: 14px;
    }

    /*去除分页a标签的默认样式并把字体改为黑色*/
    .href_a,
    .href_number {
      text-decoration: none;
      color: black;
    }

    /*鼠标点击数字链接时*/
    .href_number:active {
      color: rgb(255, 255, 255);
      background: rgb(57, 28, 223);
      width: 38px;
      height: 29px;
      border-radius: 6px;
    }

    /*鼠标点击上一页下一页时*/
    .href_a:active {
      color: rgb(255, 255, 255);
      background: rgb(57, 28, 223);
      width: 75px;
      height: 35px;
      border-radius: 6px;
    }

    /*上一页下一页样式*/
    .upper {
      display: inline-block;
      clear: both;
      text-align: center;
      line-height: 29px;
      color: black;
      background: rgb(199, 199, 199);
      width: 75px;
      height: 29px;
      border-radius: 6px;
    }

    /*数字链接样式*/
    .page {
      display: inline-block;
      clear: both;
      text-align: center;
      line-height: 29px;
      color: black;
      background: rgb(199, 199, 199);
      width: 38px;
      height: 29px;
      border-radius: 6px;
    }

    /* 鼠标移动到上一页下一页时 */
    .upper:hover {
      color: rgb(255, 255, 255);
      background: #2e94cc;
    }

    /* 鼠标移动到页码上时 */
    .page:hover {
      color: rgb(255, 255, 255);
      background: #2e94cc;
    }
    /* 当前页码样式 */
    .page_page {
      display: inline-block;
      clear: both;
      text-align: center;
      line-height: 29px;
      color: rgb(255, 255, 255);
      background: #2e94cc;
      width: 38px;
      height: 29px;
      border-radius: 6px;
    }
  </style>
</head>
<body>
  <!-- 给定整个页面一个div -->
  <div class="Whole">
    <!-- 循环写入数据 -->
    {% for b in page %}
    <!-- 给定一个文章模块 -->
    <div class="Single">
      <div class="Title" onclick="window.open('http://127.0.0.1:8000/person_info/{{ b.username }}')"><b>{{ b.title }}</b></div>
      <div class="Content" onclick="window.open('http://127.0.0.1:8000/person_info/{{ b.username }}')">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<samp>{{ b.content }}</samp></div>
      <div class="category">
        <small><button onclick="window.open('http://www.taobao.com/')">联系我</button></small>
        <small><b>{{ b.dispute }}</b></small>
        <small><b>{{ b.create }}</b></small>
        <small><b>{{ b.username }}</b></small>
        <small><b>{{ b.id }}</b></small>
      </div>
    </div>
    {% endfor %}
    <!-- 设置页面的分页效果 -->
    <div class="Button">
      {% if page.has_previous %}
      <a href="{% url 'book' %}?page={{ page.previous_page_number }}" class="href_a"><span class="upper">上一页</span></a>
      {% else %}
      <span class="upper">上一页</span>
      {% endif %}
      {% for p in paginator.page_range %}
      {% if p == page.number %}
      <span class="page_page">{{ p }}</span>
      {% else %}
      <a href="{% url 'book' %}?page={{ p }}" class="href_number"><span class="page">{{ p }}</span></a>
      {% endif %}
      {% endfor %}
      {% if page.has_next %}
      <a href="{% url 'book' %}?page={{ page.next_page_number }}" class="href_a"><span class="upper">下一页</span></a>
      {% else %}
      <span class="upper">下一页</span>
      {% endif %}
    </div>
  </div>
</body>
</html>